package vn.gq.udv.bean;

import org.json.JSONException;
import org.json.JSONObject;

public class Version {
	
	public static final String VERSION_CODE = "vcode";
	public static final String URL = "url";
	public static final String MSG = "msg";
	
	public int versionCode;
	public String url;
	public String msg;
	
	public Version() {
	}
	
	public Version(JSONObject in) {
		try {
			versionCode = in.getInt(VERSION_CODE);
			url = in.getString(URL);
			msg = in.getString(MSG);
		} catch(JSONException e) {
			e.printStackTrace();
		}
	}
	
	public String toJsonStr() throws JSONException {
		JSONObject ob = new JSONObject();
		ob.put(VERSION_CODE, versionCode);
		ob.put(URL, url);
		ob.put(MSG, msg);
		return ob.toString();
	}
}
